Skip to content

feat(control): show limits and measured response in Now and charging - #75

Open
frahlg wants to merge 11 commits into
mainfrom
feat/control-feedback
Open

frahlg wants to merge 11 commits into
mainfrom
feat/control-feedback

Conversation

@frahlg

@frahlg frahlg commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

The battery, solar and charging panels answer "Are we in control?" first, with the box's own words: Following FTW, Waiting, Limited, Not following, No contact or Not controlled, one sentence and, when the owner can act, the next step. "How FTW knows" folds the receipt (sent, accepted, measured, confirmed by a separate grid meter), numbers and the response curve.

The box decides status, severity and evidence; the app renders them and no longer derives its own tone from reasons. That fixes three defects found in review: a stale grid meter painted every bubble red, a finished car read as "a state this app does not recognise", and device fault rows never appeared. The overview marks only warnings (amber) and alarms (red), and a combined bubble keeps the worst. The charging status line keeps power first; a warning no longer replaces it.

The control words are vendored from the box under src/vendor/ftw with a provenance header and a recorded digest, like the flow component, so drift fails tests/vendored.test.ts. The box's DOM renderer no longer ships in the app: the entry bundle is 82.6 kB gzip, down from 85.1 kB (limit 90 kB).

Paired with srcfl/ftw#1474 (copied from 6716098a) and srcfl/device-drivers#149.

Validation: npm run verify (svelte-check, 1,046 tests passed and one skipped, build), the contract check (registry and push catalogue byte for byte) and the token check (no drift). Browser review of the panels in the simulated site with injected status rows: following and confirmed, then not following with the amber mark, at 390 px.

This remains draft. Live remote-client validation remains.

🤖 Generated with Claude Code

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ftw-webapp 9729a9f Commit Preview URL

Branch Preview URL
Oct 01 2026, 09:28 AM

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
frahlg and others added 8 commits September 29, 2026 19:35
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Paired with srcfl/ftw#1474 at 6716098a. The box now states status,
severity and evidence; the app renders them instead of deriving its own
tone from reasons, so a stale grid meter no longer paints every bubble red
and a finished car reads "Car is full" instead of an unknown state.

The panels open with the answer, one sentence and the next step, and keep
"How FTW knows" folded with an evidence receipt, numbers and curves. Marks
appear only for warning (amber) and alarm (red). The charging status line
keeps power first; a warning no longer replaces it.

The control words are now vendored from the box under src/vendor/ftw with
a provenance header and recorded digest, like the flow component, so drift
fails the vendored test. The box's DOM renderer no longer ships here: the
entry bundle is 82.6 kB gzip, down from 85.1 kB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@frahlg
frahlg marked this pull request as ready for review October 1, 2026 14:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9729a9fe6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const capital = text => text.charAt(0).toUpperCase() + text.slice(1);

// Site convention: positive power is drawn into the site, so a battery or car
// charges and solar is negative.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat zero-output solar as idle before labeling production

When Core emits an idle or power_observed PV row with actual_w equal to zero or missing, this early return bypasses the idle check, so the new status card says “Producing 0 W” or “Producing unknown” (for example, every night). Check for an absent/idle measurement before applying the PV-specific “producing” label.

Useful? React with 👍 / 👎.

Comment on lines +265 to +267
const name = planet.id?.startsWith('agg-') ? '' : planet.name;
return controlRows(value).filter(row => (!name || row.driver === name) &&
(!planet.role || row.kind === planet.role || row.kind === 'device' || planet.role === 'ev' && row.kind === 'v2x_charger'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude unrelated device rows from Grid and Home panels

When a generic feedback row has kind: 'device', opening Grid or Home passes an unnamed grid/load scope from Now.svelte; !name then accepts every driver and this role condition accepts every generic device row. Consequently, a battery-inverter or charger alarm appears in the Grid and Home sheets as if it were evidence for those readings. Generic rows should only be admitted when the selected scope identifies the same driver, and should be excluded from the unnamed grid/load scopes.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T14:38:46.459121Z 9729a9f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant